package com.example.pkmedical.Activity.weight.tozero;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.pkmedical.APP.MyApp;
import com.example.pkmedical.Base.BaseActivity;
import com.example.pkmedical.MainActivity;
import com.example.pkmedical.R;
import com.example.pkmedical.Utils.CommandUtil;
import com.example.pkmedical.Utils.SPUtils;
import com.example.pkmedical.Utils.TimeUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ToZeroSuccessActivity extends BaseActivity {

    @BindView(R.id.tozero_success_button)
    Button tozeroSuccessButton;
    @BindView(R.id.tozero_img)
    ImageView tozeroImg;
//    @BindView(R.id.tozero_onetext)
//    TextView tozeroOnetext;
    @BindView(R.id.tozero_twotext)
    TextView tozeroTwotext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tozerosuccess);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initView() {
        switch (CommandUtil.ZERO_TYPE) {
            case 1:
                SPUtils.getInstance().put("TOZERO_DATA", TimeUtils.getNowData());
                tozeroImg.setImageResource(R.drawable.img_zero_remind_pictwo);
//                tozeroOnetext.setText(getString(R.string.weight_history_deleted_no));
                tozeroTwotext.setText(getString(R.string.weight_zero_ok));
                break;
            case 2:
                SPUtils.getInstance().put("NEWUSER_ZERO_DATA", TimeUtils.getNowData());
                tozeroImg.setImageResource(R.drawable.img_newuserzero);
//                tozeroOnetext.setText(getString(R.string.weight_history_deleted));
                tozeroTwotext.setText(getString(R.string.weight_zero_ok));
                break;
        }
    }

    @Override
    public void initPresenter() {

    }

    @Override
    public void showDialog(String... msg) {

    }

    @OnClick(R.id.tozero_success_button)
    public void onViewClicked() {
        startActivity(new Intent(MyApp.getAppContext(), MainActivity.class));
    }
}
